#include"bits/stdc++.h"
using namespace std;
int sw,h;
long long number_1;
bool number_have_x(int number,int x)
{
	number_1=number;
	while(number)
	{
		sw=number%10;
		if(sw==x)
		{
			h++;
		}
		number/=10;
	}
	if(h==2)
	{
		return true;
	}
	else
	{
		return false;
	}
}
long long n;
int main()
{
	
	int x;
	cin>>n>>x;
	if(number_have_x(n,x))
	{
		cout<<"Yes";
	}
	else
	{
		cout<<"No";
	}
}
